Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bayesian interface for Wideband data (No correlated noise) #1426

Merged
merged 60 commits into from
Sep 26, 2023

Conversation

abhisrkckl
Copy link
Contributor

@abhisrkckl abhisrkckl commented Oct 20, 2022

I have implemented the Bayesian interface for analyzing wideband data. Correlated noise is still TODO..

I have created a new example script bayesian-wideband-example.py for this feature.

Here is a posterior corner plot from running this script.
bayesian-wb.jpg

@abhisrkckl abhisrkckl requested a review from dlakaplan October 20, 2022 20:51
@abhisrkckl abhisrkckl added the awaiting review This PR needs someone to review it so it can be merged label Oct 20, 2022
@dlakaplan
Copy link
Contributor

The corner plot looks good. Can you add the best-fit values from standard fitting to the plot (as truths)? Or at least confirm that it agrees?

@abhisrkckl
Copy link
Contributor Author

Do you mean the pre-fit values present in the par file or post-fit values obtained using something like WidebandTOAFitter?

src/pint/bayesian.py Outdated Show resolved Hide resolved
@dlakaplan
Copy link
Contributor

post-fit

@dlakaplan
Copy link
Contributor

dlakaplan commented Oct 20, 2022

I think the docstring formatting is slightly different than what we've adopted elsewhere. For instance, it should be:

"""Basic implementation of a factorized log prior.

         More complex priors must be separately implemented.
        Parameters
        ------------
            params : array-like 
                Parameters

        Returns:
        --------
            float: 
                Value of the log-prior at params
"""

so the data-type and description should go on different lines. This will be easiest to see when the RTD build finishes, or if you build locally, but it's not doing all of the normal parsing as-is. (Not all of the indenting is right above, but hopefully you get the idea)

@abhisrkckl
Copy link
Contributor Author

Here is the plot with truths. (The EFAC1 and DMEFAC1 are taken from the par file.)
wb-corner

I am not sure why the EFAC1 and DMEFAC1 are not agreeing very well. I'll run an ENTERPRISE analysis and compare with this.

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (2cb572b) 68.54% compared to head (d027f08) 68.55%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1426   +/-   ##
=======================================
  Coverage   68.54%   68.55%           
=======================================
  Files         103      103           
  Lines       23502    23514   +12     
  Branches     4098     4098           
=======================================
+ Hits        16110    16120   +10     
- Misses       6377     6378    +1     
- Partials     1015     1016    +1     
Files Changed Coverage Δ
src/pint/utils.py 56.96% <ø> (ø)
src/pint/bayesian.py 92.40% <100.00%> (-4.61%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dlakaplan
Copy link
Contributor

The RTD build failed, but that may have just been a timeout. Otherwise this looks good but I agree the fit discrepancy should be sorted out.

@abhisrkckl abhisrkckl marked this pull request as draft November 15, 2022 18:02
@abhisrkckl abhisrkckl changed the title Bayesian interface for Wideband data (No correlated noise) WIP: Bayesian interface for Wideband data (No correlated noise) Dec 1, 2022
@abhisrkckl
Copy link
Contributor Author

I have merged the master into this and did a few more simulations to make sure it is giving correct answers. This works as far as I can see.

See a simulation result below:
Figure_1

Timing model parameters (especially DM and DM1) have been recovered correctly.
It looks like EFAC1 and DMEFAC1 have been overestimated, but this is an issue with the simulation and not with the analysis. I calculated the EFAC and DMEFAC by hand from the TOA and DM residuals, and they agree with the results above.

@abhisrkckl abhisrkckl marked this pull request as ready for review August 18, 2023 20:17
@abhisrkckl abhisrkckl changed the title WIP: Bayesian interface for Wideband data (No correlated noise) Bayesian interface for Wideband data (No correlated noise) Aug 18, 2023
@dlakaplan
Copy link
Contributor

New notebooks look good.

@abhisrkckl
Copy link
Contributor Author

New notebooks look good.

This is ready to go, then.

@dlakaplan dlakaplan merged commit 11ccc5d into nanograv:master Sep 26, 2023
8 checks passed
@abhisrkckl abhisrkckl deleted the bayesian-wip branch May 14, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review This PR needs someone to review it so it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants